from django.db import models
from django.contrib.auth.models import User

SPACE_STATUS_ON_SCHEDULE      = 1
SPACE_STATUS_BEHIND_SCHEDULE  = 2
SPACE_STATUS_COMPLETE         = 3
space_status_codes            = {SPACE_STATUS_ON_SCHEDULE:     'On Schedule', 
                                SPACE_STATUS_BEHIND_SCHEDULE: 'Behind Schedule', 
                                SPACE_STATUS_COMPLETE:        'Complete' }


class Space(models.Model):
    name = models.CharField(maxlength=255, unique=True)
    description = models.CharField(maxlength=255)
    status = models.IntegerField(default=SPACE_STATUS_ON_SCHEDULE)
    parent_space = models.ForeignKey('self')
    admin = models.ForeignKey(User)

    def __str__(self):
        return self.name
